package com.example.espect.beans;

import com.example.espect.mybatissample.mapper.CityMapper;
import com.example.espect.mybatissample.model.City;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author ext.shengsongtao
 * @Date 2020-10-09 10:52
 */
@Component
public class Mybean {
    private final CityMapper cityMapper;

    public Mybean(CityMapper cityMapper) {
        this.cityMapper = cityMapper;
    }
    public void doTrans(){
        City city = new City();
        city.setName("ll");
        city.setState("CA");
        city.setCountry("US");
        cityMapper.insert(city);
//        throw new RuntimeException("~~~");
    }
}
